<?php
/**
* エラーチェッククラス
**/
require_once( '../system/Class_M_DAO.php' );
class Class_M_MAP_GROUP extends Class_M_DAO {
	//protected properties begin
	/**
	 *
	 * テーブル名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_table  = "M_MAP_GROUP";
	
	/**
	 *
	 * 主キー名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_pkey   = "map_no";
	
	/**
	 *
	 * ソート順
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	 protected $_order = "map_no";
	 
	 protected $_cols  = array(
		"map_no"      => array(AOKI_VARTYPE_STR),
		"sort"        => array(AOKI_VARTYPE_STR),
		"media_cd"    => array(AOKI_VARTYPE_STR),
		"media_name"  => array(AOKI_VARTYPE_STR)
	 );
	
	 protected $_checks  = array(
		"map_no"     => array( "EXIST","NUM" ),
	 );
	 
	 //maxlength 
	 protected $_maxlens  = array(	
	 	"map_no "    => 10,
		"sort "      => 1
	 );
	
	 public function search($where ,&$page = NULL ){	
	 	
		$sql = "SELECT a.*,(select  user_name FROM M_LOGIN where id  = a.u_user) as m_user_name from {$this->_table}  a ";

		return  parent::search($where ,$page ,$sql);
	}
	
	 public function  get_all_mapno() {
	 	$sql ="SELECT * from {$this->_table}  ";
	 			$this->_db->query( $sql );
		$data = array();
		while( $row = $this->_db->fetch() ){
			$data[] = $row["map_no"];
		}
		return $data;
	 } 
}

?>